.class public final Lnbisdk/mj;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/t;


# static fields
.field private static qU:Lnbisdk/jz;

.field private static qV:Lnbisdk/bs;


# instance fields
.field private dJ:Landroid/content/Context;

.field private qT:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lnbisdk/mj;->qU:Lnbisdk/jz;

    return-void
.end method

.method public constructor <init>(Lcom/nbi/common/NBIContext;Ljava/lang/String;Ljava/lang/String;)V
    .locals 4

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p3, p0, Lnbisdk/mj;->qT:Ljava/lang/String;

    invoke-virtual {p1}, Lcom/nbi/common/NBIContext;->getInternalObject()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/bl;

    invoke-virtual {v0}, Lnbisdk/bl;->jw()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/mj;->dJ:Landroid/content/Context;

    sget-object v0, Lnbisdk/mj;->qV:Lnbisdk/bs;

    if-nez v0, :cond_0

    new-instance v0, Lnbisdk/bs;

    iget-object v1, p0, Lnbisdk/mj;->dJ:Landroid/content/Context;

    const-string v2, "respak.zip"

    invoke-direct {v0, v1, v2}, Lnbisdk/bs;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    sput-object v0, Lnbisdk/mj;->qV:Lnbisdk/bs;

    :cond_0
    sget-object v0, Lnbisdk/mj;->qU:Lnbisdk/jz;

    if-nez v0, :cond_1

    :try_start_0
    sget-object v0, Lnbisdk/mj;->qV:Lnbisdk/bs;

    iget-object v1, p0, Lnbisdk/mj;->dJ:Landroid/content/Context;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "directions/"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v2}, Lnbisdk/bs;->a(Landroid/content/Context;Ljava/lang/String;)[B

    move-result-object v0

    if-eqz v0, :cond_3

    new-instance v1, Ljava/io/ByteArrayInputStream;

    invoke-direct {v1, v0}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    move-object v0, v1

    :goto_0
    if-nez v0, :cond_2

    new-instance v0, Ljava/io/IOException;

    const-string v1, "Template Library not found"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    :cond_1
    :goto_1
    return-void

    :cond_2
    :try_start_1
    invoke-static {v0}, Lnbisdk/fm;->a(Ljava/io/InputStream;)Lnbisdk/jz;

    move-result-object v0

    sput-object v0, Lnbisdk/mj;->qU:Lnbisdk/jz;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    :cond_3
    move-object v0, v3

    goto :goto_0
.end method


# virtual methods
.method public final C()Ljava/lang/Object;
    .locals 5

    const/4 v0, 0x0

    :try_start_0
    sget-object v1, Lnbisdk/mj;->qV:Lnbisdk/bs;

    iget-object v2, p0, Lnbisdk/mj;->dJ:Landroid/content/Context;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "directions/"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, p0, Lnbisdk/mj;->qT:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lnbisdk/bs;->a(Landroid/content/Context;Ljava/lang/String;)[B

    move-result-object v1

    if-nez v1, :cond_0

    new-instance v1, Ljava/io/IOException;

    const-string v2, "Resource File not found"

    invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lnbisdk/rp; {:try_start_0 .. :try_end_0} :catch_1
    .catch Lnbisdk/rt; {:try_start_0 .. :try_end_0} :catch_2

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    :goto_0
    return-object v0

    :cond_0
    :try_start_1
    sget-object v2, Lnbisdk/mj;->qU:Lnbisdk/jz;

    new-instance v3, Lnbisdk/lo;

    invoke-direct {v3, v1}, Lnbisdk/lo;-><init>([B)V

    invoke-static {v2, v3}, Lnbisdk/gq;->a(Lnbisdk/jz;Lnbisdk/ou;)Lnbisdk/fk;
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Lnbisdk/rp; {:try_start_1 .. :try_end_1} :catch_1
    .catch Lnbisdk/rt; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v0

    goto :goto_0

    :catch_1
    move-exception v1

    invoke-virtual {v1}, Lnbisdk/rp;->printStackTrace()V

    goto :goto_0

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Lnbisdk/rt;->printStackTrace()V

    goto :goto_0
.end method
